package servlet;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import java.io.IOException;

@WebServlet("/LoginCheck")
public class LoginCheck extends HttpServlet {
    @Override
    public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
        //获取用户在客户端浏览器上文本框uname输入的数据
        String username=req.getParameter("uname");
        //服务器往客户端写字符串your name is:用户名
        res.getWriter().println("your name is: "+username);
        //服务器控制台上打印字符串this message is from：用户名
        System.out.println("this message is from :"+username);
    }
}
